const express = require('express')
const db = require('../config/db')

const router = express.Router()

//查询内容
router.get('/auth/content', async (req, res) => {
    const mql = 'select * from auth'
    const result =  await db.query(mql)
    res.send({
        code: 200 ,
        msg: '请求成功!!!',
        data: result,
    })
})

//查询用户
router.get('/auth/user', async (req, res) => {
    const mql = 'select * from author'
    const result =  await db.query(mql)
    res.send({
        code: 200,
        msg: '请求成功!!!',
        data: result[0],
    })
})


module.exports = router